<?php
class admin_contentController extends adminController{

    //首页
    public function index() {
        $fid=intval($_GET['fid']);
        $this->alert_str($fid,'int');
        $this->info=model('filter_list')->info($fid);
        $this->list=model('filter')->filter_list($fid);
        $this->show();  
    }

    //添加
    public function add() {
        $fid=intval($_GET['fid']);
        $this->alert_str($fid,'int');
        $this->filter_info=model('filter_list')->info($fid);
        $this->action_name='添加';
        $this->action='add';
        $this->show('admin_content/info'); 
    }

    public function add_save() {
        //录入模型处理
        model('filter')->add($_POST);
        $this->msg('选项添加成功！',1);
    }

    //修改
    public function edit() {
        $id=$_GET['id'];
        $this->alert_str($id,'int');
        $this->info=model('filter')->info($id);
        $this->filter_info=model('filter_list')->info($this->info['fid']);
        $this->action_name='编辑';
        $this->action='edit';
        $this->show('admin_content/info'); 
    }

    public function edit_save() {
        $id=$_POST['id'];
        $this->alert_str($id,'int',true);
        $fid=$_POST['fid'];
        $this->alert_str($fid,'int',true);
        //录入模型处理
        model('filter')->edit($_POST);
        $this->msg('选项修改成功! ',1);
    }

    //删除
    public function del() {
        $id=intval($_POST['id']);
        $this->alert_str($id,'int',true); 
        //录入模型处理
        model('filter')->del($id);
        $this->msg('选项删除成功！',1);
    }





}